#include <stdio.h>

#define     MAXSIZE     10
#define     TYPE    int

typedef struct List {
    TYPE array[MAXSIZE];
    int lenght;

}LIST;


void shellSort(LIST *);

int main()
{


    return 0;
}

//ascend sort
void shellSort(LIST * L)
{
    int i, j;
    int increment = L->lenght;
    TYPE temp;

    do {
        increment = increment / 3 + 1;
        for (i = increment ; i <= L->lenght; i++) {
            if (L->array[i] < L->array[i - increment]) {
                temp = L->array[i];
                for (j = i - increment; j > 0 && temp < L->array[j]; j -= increment) {
                    L->array[j + increment] = L->array[j];
                }
                L->array[j + increment] = temp;
            }
        }
    }while (increment > 1);
}
